Repository navigation
fix(rows): return 404 when a row is not reachable through the view or table - #3178
Open
rubenvdlinde wants to merge 1 commit into
Open
rubenvdlinde wants to merge 1 commit into
rubenvdlinde wants to merge 1 commit into
Conversation
… table Updating or deleting a row through a view returned an internal error, and so a 500, when the row was not in that view. Deleting through a view that does not exist, and updating or deleting a row through a table it does not belong to, did the same. These now throw NotFoundError, which every API layer already maps to 404. Permission failures stay 403. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ruben van der Linde <ruben@conduction.nl>
rubenvdlinde
force-pushed
the
fix/noid/view-row-404
branch
from
November 3, 2026 14:51
9fe0711 to
d5805fd
Compare
rubenvdlinde
marked this pull request as ready for review
November 6, 2026 08:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updating or deleting a row through a view answered with a 500 when the row was not in that view. The same happened when you deleted through a view that does not exist, and when you updated or deleted a row through a table it does not belong to. In all these cases the row simply isn't there for you, so the answer should be a 404.
@remko48 pointed this out on #3075: it "was already a 500 for normal views too". The 404 guard that came out of that only covers views without a table. This pull request does the same for normal views and tables.
What changes
In
RowService::updateSet()andRowService::delete():NotFoundErrorinstead ofInternalError.delete(), a view that does not exist throwsNotFoundError.updateSet()already did this.NotFoundError.Permission failures still throw
PermissionErrorand stay 403. The controllers did not need changes: api/1, api/2 and the internal row routes already mapNotFoundErrorto 404.Api1Controller::updateRow()does not catch it itself, butPermissionMiddleware::afterException()turns it into a 404.How it was tested
New unit test
tests/unit/Service/RowServiceRowNotFoundTest.php, one test per case plus one that checks a missing delete permission is still aPermissionError. Without the fix, the five not-found tests fail withInternalError:On a local instance, with row 12 in table 3 but outside the filter of view 1, and table 4 that does not own row 12:
PUT /rows/12?viewId=1DELETE /views/1/rows/12PUT views/1/rows/12DELETE views/1/rows/12PUT /row/12?viewId=1DELETE /view/1/row/12PUT tables/4/rows/12DELETE tables/4/rows/12🖼️ Screenshots
Backend only, no visual change.
🏁 Checklist
/backport to stableX.X🤖 AI (if applicable)